/**
 * 	 DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
 *   @author Colin Redmond
 *   Copyright (C) 2011 Colin Redmond
 *
 *   Licensed under the Apache License, Version 2.0 (the "License");
 *   you may not use this file except in compliance with the License.
 *   You may obtain a copy of the License at
 *
 *       http://www.apache.org/licenses/LICENSE-2.0
 *
 *   Unless required by applicable law or agreed to in writing, software
 *   distributed under the License is distributed on an "AS IS" BASIS,
 *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *   See the License for the specific language governing permissions and
 *   limitations under the License.
 */

package com.cred.industries.platform.dao;

import java.sql.Connection;

import com.cred.industries.platform.business.objects.SessionBO;

public interface ISessionDAO {

	/**
	 * Inserts the Session BO into the Db
	 * @param sessionBO the session BO to insert
	 */
	void insert(SessionBO sessionBO);

	/**
	 * Inserts the Session BO into the Db
	 * @param connect the DB connection used to insert, assumed to be a session. Caller must manager
	 * @param sessionBO the session BO to insert
	 */
	void insert(Connection connect, SessionBO sessionBO);
	
	/**
	 * update the Session BO in the DB, this will only update the TIME_ISSUED and LAST_REQUEST
	 * @param sessionBO the session BO to be updated
	 */
	void update(SessionBO sessionBO);
	
	/**
	 * update the Session BO in the DB, this will only update the TIME_ISSUED and LAST_REQUEST
	 * @param connect the DB connection used to insert, assumed to be a session. Caller must manager
	 * @param sessionBO the session BO to be updated
	 */
	void update(Connection connect, SessionBO sessionBO);

	/**
	 * returns a session BO for a session by the sessionId
	 * @param sessionId the session ID we are looking for
	 * @return the found session BO for the session ID
	 */
	SessionBO findSessionById(String sessionId);

	/**
	 * deletes a session from the DB by the session BO
	 * @param sessionBO the session BO to delete 
	 * @return
	 */
	boolean delete(SessionBO sessionBO);

}